﻿using Microsoft.Win32;
using SvgTool.Client.ViewModels;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SvgTool.Client
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
       public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new MainWindowViewModel();
        }


        private void list_files_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var listBox = e.Source as ListBox;

            if (listBox != null)
            {
                var listItem = listBox.SelectedItem as SvgItem;
                if (listItem != null)
                {
                    svgIcon_show.UriSource = listItem.UriFile;
                }
            }
            

        }
    }
    public class SvgItem
    {
        public string? FilePath { get; set; }

        public Uri? UriFile { get; set; }

        public string? DisplayName { get; set; }
    }
   
}
